﻿<%@ Page Language="C#" ValidateRequest="false" AutoEventWireup="true" CodeBehind="PartyEduMateriaArticleEdit.aspx.cs" Inherits="SysManage.Module.Edu.PartyEduArticleEdit" %>


<!DOCTYPE html>
<html>
<head runat="server">
    <title></title>

</head>
<body>
    <form id="form1" runat="server" style="background-color: #0000FF" onsubmit="return UESync();">
        <f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
        <f:Panel ID="Panel1" ShowBorder="false" ShowHeader="false" AutoScroll="true" runat="server">
            <Items>
                <f:SimpleForm ID="SimpleForm1" ShowBorder="false" ShowHeader="false" runat="server"
                    BodyPadding="10px" Title="SimpleForm">
                    <Items>
                        <f:TextBox ID="txtTitle" runat="server" LabelAlign="right" Label="标题" Required="true" ShowRedStar="true" RequiredMessage="请填写文章标题">
                        </f:TextBox>
                        <%-- <f:DropDownList ID="ddlArticlesLable"  LabelAlign="right" runat="server" Label="类型" Required="true" ShowRedStar="true">
                        </f:DropDownList>--%>
                        <f:RadioButtonList ID="rblFlags" LabelAlign="right" runat="server" Label="置顶格式" Width="430px">
                        </f:RadioButtonList>
                         <f:CheckBox ID="cbxEnabled" runat="server" Label="是否发布" LabelAlign="right"></f:CheckBox>
                        <f:TextArea ID="txtSummary" Label="简介" LabelAlign="right" runat="server">
                        </f:TextArea>
                        <f:Label ID="lbContent" runat="server" LabelAlign="right" Text="文章内容："></f:Label>
                        <f:ContentPanel ID="ContentPanel1" runat="server" ShowBorder="false" ShowHeader="false">
                            <script type="text/plain" id="editor"></script>
                        </f:ContentPanel>
                    </Items>
                </f:SimpleForm>
            </Items>
            <Toolbars>
                <f:Toolbar ID="Toolbar1" runat="server" Position="Bottom" ToolbarAlign="Center">
                    <Items>
                        <f:Button ID="btnSaveClose" ValidateForms="SimpleForm1" Icon="SystemSaveClose"
                            OnClick="btnSaveClose_Click" runat="server" Text="保存并关闭">
                        </f:Button>
                        <f:ToolbarSeparator ID="ToolbarSeparator2" runat="server">
                        </f:ToolbarSeparator>
                        <f:Button ID="btnClose" Icon="SystemClose" EnablePostBack="false" runat="server"
                            Text="关闭" DisableControlBeforePostBack="True">
                        </f:Button>
                    </Items>
                </f:Toolbar>
            </Toolbars>
        </f:Panel>
    </form>
</body>
</html>
<script src="../../../../Resource/ueditor/ueditor.config.js"></script>
<script src="../../../../Resource/ueditor/ueditor.all.min.js"></script>
<script>
    var editor;
    var editorContent = '<%=EditorContent%>';
    var containerClientID= '<%= ContentPanel1.ClientID %>';
    F.ready(function() {
        

        editor = UE.getEditor("editor", {
            initialFrameWidth: '100%',
            initialFrameHeight: '200',
            enableAutoSave: false,
            saveInterval: 1000000,
            elementPathEnabled: false,
            autoHeightEnabled: false,
                onready: function () {
                    // 重新布局外部容器
                    F(containerClientID).updateLayout();
                }
        });

        editor.ready(function () {
            if (editorContent) {
                editor.setContent(editorContent);
            }
        });
    });

    function UESync() {
        var editor = UE.getEditor('editor')
        editor.sync();
        return true;
    }
    
    // 更新编辑器内容
    //function updateEditor(content) {
    //    if (editor && editor.isReady) {
    //        editor.setContent(content);
    //    }
    //}
</script>
